package org.shj.thread.book2.chapter06;


/**
 * Read-Write pattern. 适用于读操作比写操作多
 * improve 包中使用了JDK 提供的 Read-Writer Locker
 * 
 * @author huangjian
 *
 */
public class Main {

	public static void main(String[] args){
		Data data = new Data(10);
		
		for(int i = 0 ; i < 6; i++){
			new ReaderThread(data).start();
		}
		
		new WriterThread(data, "ABCDEFGHIJKLMNOPQRSTUVWXYZ").start();
		new WriterThread(data, "abcdefghijklmnopqrstuvwxyz").start();
	}
}
